//
//  XHHotPicViewModel.m
//  xinhua_sx
//
//  Created by 党阳阳 on 14-7-25.
//  Copyright (c) 2014年 dangyangyang. All rights reserved.
//

#import "XHHotPicViewModel.h"

#import "AFNetworking.h"
#import "ReactiveCocoa.h"


@interface XHHotPicViewModel()


@end

@implementation XHHotPicViewModel
- (instancetype)init
{
    self = [super init];
    if (self) {
        _urlString = [[XHURLString alloc] init];
        
        
    }
    return self;
}
- (RACSignal *)pullImageNews
{
    
    return [RACSignal createSignal:^RACDisposable *(id<RACSubscriber> subscriber) {
        AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
        manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/plain"];
        
        
        [manager GET:[_urlString getHomePageHotPic] parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
            [subscriber sendNext:responseObject];
        } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
            
        }];
        return nil;
    }];
    
    
}

@end
